﻿@model IEnumerable<MvcAlumnos.Models.Alumno>

@{
    ViewBag.Title = "Alumnos";
}

<p>
    @Html.ActionLink("Nuevo Alumno", "Create", null, new { @class = "btn btn-primary" })
    @Html.ActionLink("Buscar Alumno", "Search", null, new { @class = "btn btn-primary" })
</p>

<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th>Nombre</th>
            <th>Apellido</th>
            <th>Acciones</th>
        </tr>
    </thead>
    <tbody>
        @if (!Model.Any())
        {
            <tr>
                <td><b>No hay alumnos aún</b>
                </td>
            </tr>
        }
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Nombre)
                </td>
                <td>@Html.DisplayFor(modelItem => item.Apellido)</td>
                <td>
                    @Html.ActionLink("Editar", "Edit", new { id = item.Id }, new { @class = "btn btn-default" })
                    @Html.ActionLink("Eliminar", "Delete", new { id = item.Id }, new { @class = "btn btn-danger" })
                </td>
            </tr>
        }
    </tbody>
</table>

